<!--************************************************************ -->
<!--* 文件创建日期：2010                                  * -->
<!--* 文件修改日期：			                                   * -->
<!--************************************************************ -->
<!--JSP初始化设置-->
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="com.infomanage.po.*" %>
<%@page import="com.infomanage.vo.*" %>
<%@page import="com.infomanage.enums.*"%>
<%@page import="com.infomanage.service.rescue.*"%>
<html>
<%
	request.setCharacterEncoding("UTF-8");
	String itemId = request.getParameter("itemId");
    if(itemId == null) itemId = "";
    AccidentRescue item = AccidentRescueService.loadAccidentRescue(request, response, out);
    String accidentCommander = "";
    String accidentDept = "";
    int accidentPersonNum = 0;
    int accidentPersontDead = 0;
    String accidentPhonetime = "";
    String accidentPlace = "";
    String accidentRecorder = "";
    String accidentRequesterDept = "";
    String accidentRequesterName = "";
    String accidentRequesterPhone = "";
    String accidentTimestamp = "";
    String accidentType = "";
    String description = "";
    if(item != null){
	     accidentCommander = item.getAccidentCommander();
	     accidentDept = item.getAccidentDept();
	     accidentPersonNum = item.getAccidentPersonNum();
	     accidentPersontDead = item.getAccidentPersontDead();
	     accidentPhonetime = item.getAccidentPhonetime();
	     accidentPlace = item.getAccidentPlace();
	     accidentRecorder = item.getAccidentRecorder();
	     accidentRequesterDept = item.getAccidentRequesterDept();
	     accidentRequesterName = item.getAccidentRequesterName();
	     accidentRequesterPhone = item.getAccidentRequesterPhone();
	     accidentTimestamp = item.getAccidentTimestamp();
	     accidentType = item.getAccidentType();
	     description = item.getDescription();
    }
%>
<head>
	<title>事故电话记录</title>
	<link href="../../css/table.css" rel="stylesheet" type="text/css">
	<link href="../../css/calendar.css" rel="stylesheet" type="text/css">
	<script type="text/javascript" src="../../js/calendar.js"></script>
	<script type="text/javascript">
	// 提交
	   function doSubmit(){
	   	    if(validate()){
	   			return;
	   		}
	   	  	if("" == "<%=itemId%>") {
		 		form1.actionType.value = "add";
			}else {
		 		form1.actionType.value = "modify";
			}
            form1.submit();
	   }
	   
	   	   
   	   function validate(){
	   		if(form1.accidentDept.value == ""){
	   			alert("事故单位不能为空！");
	   			return true;
	   		}
	   		if(form1.accidentTimestamp.value == ""){
	   			alert("事发时间不能为空！");
	   			return true;
	   		}
	   		if(form1.accidentPlace.value == ""){
	   			alert("事发地点不能为空！");
	   			return true;
	   		}
	   		if(form1.accidentRequesterDept.value == ""){
	   			alert("请求人单位不能为空！");
	   			return true;
	   		}
	   		if(form1.accidentRequesterName.value == ""){
	   			alert("请求人姓名不能为空！");
	   			return true;
	   		}
	   		
	   		if(isNaN(form1.accidentPersonNum.value)){
	   			alert("遇险人员人数必须为数字！");
	   			return true;
	   		}
	   		
	   		if(isNaN(form1.accidentPersontDead.value)){
	   			alert("遇难人员人数必须为数字！");
	   			return true;
	   		}
	   		return false;
	   }
	   
	   function showError(error){
		   alert(error);
	   }

	   function showInfo(info){
		   alert(info);
		   window.returnValue = "ok";
		   window.close();
	   }
	</script>
</head>
<body  rightmargin="0" bottommargin="0" leftmargin="0" onclick="" onload="">
	<form name="form1" action="phonerecordaction.jsp" method="post" target="actionFrame">

	<input type="hidden" name="actionType">
	<input type="hidden" name="itemId" value="<%=itemId%>">
	<table class="dialogTable" cellpadding="0" cellspacing="0">
		<!-- 表头-->
		<tr class="dialogTableHeader">
			<td>事故电话记录表</td>
		</tr>
		<!-- 表数据-->
		<tr class="dialogTableContent">
			<td>
				<!-- 数据项 -->
				<table class="dataTable">
					<col width="14%">
					<col width="28%">
					<col width="18%">
					<col width="8%">
					<col width="8%">
					<col width="8%">
					<col width="8%">
					<col width="8%">
					<tr>
						<td class="field">
							事故单位
						</td>
						<td>
							<input name="accidentDept" value="<%=accidentDept %>" style="width: 100%;">
						</td>
						<td class="field">
							事发时间
						</td>
						<td colspan="7">
							<input value="<%=accidentTimestamp %>" type="text" style="width: 195px;cursor: hand;" name="accidentTimestamp" id="time" onClick="return showCalendar(this.id, 'y-mm-dd');" readonly="readonly"><img 
										src="../../img/tip_calender.gif" style="cursor: hand;" width="16" height="16" onClick="return showCalendar('time', 'y-mm-dd');">
						</td>
					</tr>
					<tr>
						<td class="field">
							事发地点
						</td>
						<td>
							<input name="accidentPlace" value="<%=accidentPlace %>" style="width: 100%;">
						</td>
						<td class="field">
							事故性质
						</td>
						<td colspan="5">
                            <input name="accidentType" value="<%= accidentType%>" style="width: 100%;">
						</td>
					</tr>
					<tr>
						<td class="field">
							遇险人员人数
						</td>
						<td>
							<input name="accidentPersonNum" value="<%= accidentPersonNum%>" style="width: 100%;">
						</td>
						<td class="field">
							遇难人员人数
						</td>
						<td colspan="5">
                            <input name="accidentPersontDead" value="<%= accidentPersontDead%>" style="width: 100%;">
						</td>
					</tr>
					<tr>
						<td class="field">
							请求人单位
						</td>
						<td>
							<input name="accidentRequesterDept" value="<%=accidentRequesterDept %>" style="width: 100%;">
						</td>
						<td class="field">
							请求人姓名
						</td>
						<td colspan="5">
                            <input name="accidentRequesterName" value="<%=accidentRequesterName %>" style="width: 100%;">
						</td>
					</tr>
					<tr>
						<td class="field">
							请求人联系电话
						</td>
						<td>
							<input name="accidentRequesterPhone" value="<%= accidentRequesterPhone%>" style="width: 100%;">
						</td>
						<td class="field">
							来电时间
						</td>
						<td colspan="5">
							<input name="accidentPhonetime" value="<%=accidentPhonetime %>" style="width: 100%;">
						</td>
					</tr>
					<tr>
						<td class="field">
							记录人
						</td>
						<td>
							<input name="accidentRecorder" value="<%=accidentRecorder %>" style="width: 100%;">
						</td>
						<td class="field">
							值班指挥员
						</td>
						<td colspan="5">
                            <input name="accidentCommander" value="<%= accidentCommander%>" style="width: 100%;">
						</td>
					</tr>
				    <tr style="height: 100px">
						<td class="field">
							备注
						</td>
						<td valign="top"  colspan="20">
							<textarea name="description" style="width: 100%;height: 100%"><%= description%></textarea>
						</td>
					</tr>


				</table>
			</td>
		</tr>
		<tr>
			<td colspan="8" class="tableBtn">
				<span onclick="doSubmit();">确定</span>
				<span onclick="window.close();">取消</span>
			</td>
		</tr>
		<tr valign="top">
			<td colspan="8">
				&nbsp;
			</td>
		</tr>
	</table>
	<iframe src="#" frameborder="0" id="treeFrame" name="frame" style="display: none;position: absolute;"></iframe>
	<iframe src="#" name="actionFrame" style="display: none;"></iframe>
</body>
</html>